package com.yazi.mxz.common.db;

import java.sql.Types;

import org.hibernate.Hibernate;
import org.hibernate.dialect.Oracle10gDialect;

public class MyOracle11gDialect extends Oracle10gDialect {

	public MyOracle11gDialect() {
		super();
		registerHibernateTypeMappings();
		registerNumericTypeMappings();
		
	}
	
	protected void registerHibernateTypeMappings() {
		registerHibernateType(Types.INTEGER, "int");
		//registerHibernateType(Types.NUMERIC, Hibernate.FLOAT.getName());
		//System.out.print("XXXXX");
	}
	
	protected void registerNumericTypeMappings() {
		registerColumnType( Types.INTEGER, "integer" );
		
		registerColumnType( Types.INTEGER, "number(1,0)" );
		registerColumnType( Types.INTEGER, "number(3,0)" );
		registerColumnType( Types.INTEGER, "number(5,0)" );
		registerColumnType( Types.INTEGER, "number(10,0)" );
		registerColumnType( Types.BIGINT, "number(19,0)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.NUMERIC, "number($p,$s)" );
		registerColumnType( Types.DECIMAL, "number($p,$s)" );

	}
}
